word problems involving permutations